#pragma once

#include <list>
#include <vector>

#include "OptionRadioButton.h"
#include "OptionStringEdit.h"

// OptionWin

class OptionWin : public CWnd
{
	DECLARE_DYNAMIC(OptionWin)

public:
	OptionWin();
	virtual ~OptionWin();

	void SwitchToNull(void);
	void SwitchToString(void);
	void SwitchToInteger(void);
	void SwitchToRadio(void);
	void SwitchToBool(void);

	void SetOptionString(LPCTSTR str);
	void SetOptionInteger(int n);
	void SetOptionBool(bool b);
	void AddRadio(LPCTSTR value, LPCTSTR text);
	void SelectRadio(LPCTSTR value);

	void ShowTitle(LPCTSTR str);

	void UpdateOption(void);

private:
	enum {
		ST_STRING,
		ST_RADIO,
	}m_status;
	CStatic m_title;
	OptionStringEdit m_editStr;
	class Radio {
	public:
		Radio(CString v, CString t, OptionWin* p, bool group = false);
		~Radio();
		CString value;
		CString text;
		COptionRadioButton button;
		OptionWin * parent;
	};
	std::vector<Radio*> m_radios;
	void ClearRadios(void);

protected:
	DECLARE_MESSAGE_MAP()
public:
	afx_msg int OnCreate(LPCREATESTRUCT lpCreateStruct);
	afx_msg void OnSize(UINT nType, int cx, int cy);
	afx_msg BOOL OnEraseBkgnd(CDC* pDC);
	afx_msg void OnPaint();
};


